package com.quanyan.travel.biz;

import com.quanyan.travel.entity.*;
import com.quanyan.travel.entity.vo.Master;
import com.quanyan.travel.entity.vo.ProductDetail;

import java.util.List;

/**
 * Created by xiao.lai on 16/5/26.
 */
public interface BizTravelOrderService {

    List<TbOutdoorActivity> queryActivityByIds(List<Integer> ids);

    TbOutdoorActivity queryActivityById(Integer id);

    List<TbOutdoorProduct> queryProductByIds(List<Integer> ids);

    /**
     * 自定义关联查询
     *
     * */
    List<ProductDetail> queryProductDetailByIds(List<Integer> ids);

    TbOutdoorDiscount queryTbOutdoorDiscountById(Integer id);

    TbOutdoorDiscount queryTbOutdoorDiscountByActivityId(Integer id);

    boolean updateTravelStorage(Integer id, int num);

    boolean recoveryTravelStorage(Integer id, int num);

    int updateTbOutdoorActivity(List<Integer> ids);

    int updateNotShwoActivity(List<Integer> ids);

    int updateTbOutdoorProduct(List<Integer> activityIds);

    int updateThemeProduct(List<Integer> productIds);

    TbOutdoorOrder insertTravelOrder(TbOutdoorOrder tbOutdoorOrder);

    TbOutdoorOrder queryOutDoorOrderByOrderNo(String orderNo);

    int queryOutDoorOrderNumByUid(Integer uid);

    List<TbOutdoorOrder> queryOutDoorOrderListByUid(Integer uid, Integer pageNum, Integer pageSize);

    TbOutdoorOrder updateTbOutDoorOrder(TbOutdoorOrder tbOutdoorOrder);

    TbOutdoorOrder updateTbOutDoorOrderByTradeOrderNo(TbOutdoorOrder tbOutdoorOrder, String tradeOrderNo);

    int updateTbOutDoorOrderByOrderNo(TbOutdoorOrder tbOutdoorOrder, String orderNo);

    boolean cancelSignUserByOrderId(Integer orderId);

    List<TbOutdoorOrder> queryExpireOrder();

    /**
     *  处于支付期间的提醒, 5分钟提醒
     * */
    List<TbOutdoorOrder> queryPayingOrder();

    List<Master> queryOutdoorMaster(List<Integer> ids);

    TbOutdoorActivity insertTbOutdoorActivity(TbOutdoorActivity tbOutdoorActivity);

    TbOutdoorActivityDesc insertTbOutdoorActivityDesc(TbOutdoorActivityDesc tbOutdoorActivityDesc);

    TbOutdoorActivityMaster insertTbOutdoorActivityMaster(TbOutdoorActivityMaster tbOutdoorActivityMaster);

    TbOutdoorProduct insertTbOutdoorProduct(TbOutdoorProduct tbOutdoorProduct);

    TbOutdoorDiscount insertTbOutdoorDiscount(TbOutdoorDiscount tbOutdoorDiscount);

    TbOutdoorTheme insertTbOutdoorTheme(TbOutdoorTheme tbOutdoorTheme);

    TbOutdoorSignUser insertTbOutdoorSignUser(TbOutdoorSignUser tbOutdoorSignUser);

    TbOutdoorActivityDestination queryTbOutdoorActivityDestinationByActivityId(Integer activityId);

    TbOutdoorDestination queryTbOutdoorDestinationById(Integer id);

    /**
     * 该用户是否存在未支付订单
     *
     * */
    boolean isExistWaitPayOrder(Integer uid, List<Integer> productIds);

    /**
     * 查询过期活动
     *
     * */
    List<Integer> selectExpireActivity();

    /**
     * 首页不显示的活动
     * @return
     */
    List<Integer> indexNotShow();
    /**
     * 查询未过期季度活动
     *
     * */
    List<TbOutdoorActivity> selectNotExpireThemeActivityList();

    List<ProductDetail> searchUsableProductDetail(String key, Integer pageNum, Integer pageSize);

    /**
     * 把未过期的活动场次放入redis缓存
     */
    void cacheProductListByActivityId();


}
